{extend name="public/base"/}
{block name="style"}
	<link href="__PUBLIC__/ieasy/css/classify.css?v=2.1.49" rel="stylesheet" type="text/css">

	<link rel="stylesheet" href="__PUBLIC__/ieasy/css/vendor.css">

    <link rel="stylesheet" href="__PUBLIC__/ieasy/css/front.css">

    <script src="__PUBLIC__/ieasy/js/vendor.js"></script>
    

    <link href="__PUBLIC__/ieasy/css/font_apds0v8n2bhp8pvi.css" rel="stylesheet">
	<style>
	.product-item .icon-hot {
		position: absolute;
		color: #ff4500;
		font-size: 36px;
		top: -14px;
		right: -10px;
		width: 26px;
		height: 34px;
	}
	</style>
{/block}
{block name="body"}
<div id="console_main"></div>
<div class="head_tit_box">
	<a  class="head_return_page_but"></a>
		<div class="head_menu_but_box">
		
	</div>
		<h1>充值</h1>
</div>
 <body class=" has-footer-nav">

    <div class="container">

    <div class="cell">

      
                <div class="bd">
				<div style='margin:0 10px;font-size:16px;padding-top:3em'> 

                    您的余额: <span style='color:darkorange'>{$user.egold}</span> {:config('virtualname')} <span style='color:darkorange'>{$user['zb']+$user['sign_score']}</span>书币

                </div>                        <hr>

            <div style="margin:10px 10px;font-size:16px;">

                选择充值金额 <span style="color:orangered">(1元=100{:config('virtualname')})</span>
				<p style="color:#ccc">赠送书币有效期为{:config('pay_expire')}天，过期自动失效，阅读时优先扣除赠送书币
            </div>
		<div id="products-grid" class="products-grid clearfix"> 
	{empty name="paysetting"}
		{notempty name="diy_product"}
			{volist name="diy_product" id="vo"}
			<div class="product-cell"> 
				<div class="product-item {if $vo.default ==1}active{/if}" data-money='{$vo.price|floatval}'  data-type='{$vo.type}' data-activityid='0' data-payid='{$vo.payid}' data-userlimit='{$vo.user_limit}'> 
					 <div class="product-welth">
					  <span class="value">{if $i==6}<i class='iconfont icon-diamond' style='color:goldenrod'></i>{/if}{$vo.price|floatval}元{if $vo.user_limit>0}(限充{$vo.user_limit}次){/if}</span>
					 </div> 
					<div class="product-info">{$vo.egold}{:config('virtualname')}{if $vo.giveegold>0}+{$vo.giveegold}书币{/if}      <br /> {if $vo.giveegold>0}多送{$vo.giveegold}书币{else}<br />{/if}</div> 
				</div> 
			</div> 
			{/volist}
		{/notempty}

		{notempty name="custom_product"}
			{volist name="custom_product" id="vo"}
			<div class="product-cell"> 
				<div class="product-item" data-money='{$vo.price|floatval}'  data-type='{$vo.type}' data-activityid='{$vo.activityid}' data-payid='{$vo.payid}' data-userlimit='0'> 
					 <div class="product-welth">
					  <span class="value">{if $i==6}<i class='iconfont icon-diamond' style='color:goldenrod'></i>{/if}{$vo.price|floatval}元{if $vo.user_limit>0}(限充{$vo.user_limit}次){/if}</span>
					 </div> 
					<div class="product-info">{$vo.egold}{:config('virtualname')}+{$vo.giveegold}书币      <br /> {if $vo.giveegold>0}多送{$vo.giveegold}书币{else}<br />{/if}</div><img src="/public/images/icon_sale.png" class="icon-hot">
				</div> 
			</div>
			{/volist}
		{/notempty}

		{notempty name="platform_product"}
			{volist name="platform_product" id="vo"}
			<div class="product-cell"> 
				<div class="product-item" data-money='{$vo.price|floatval}'  data-type='{$vo.type}' data-activityid='{$vo.activityid}' data-payid='{$vo.payid}' data-userlimit='0'> 
					 <div class="product-welth">
					  <span class="value">{if $i==6}<i class='iconfont icon-diamond' style='color:goldenrod'></i>{/if}{$vo.price|floatval}元{if $vo.user_limit>0}(限充{$vo.user_limit}次){/if}</span>
					 </div> 
					<div class="product-info">{$vo.egold}{:config('virtualname')}+{$vo.giveegold}书币      <br /> {if $vo.giveegold>0}多送{$vo.giveegold}书币{else}<br />{/if}</div> 
					{if empty($type)&&$pay_setting_diy&&$i==$pay_setting_diy['default_hot']}<i class='iconfont icon-hot'></i>{/if}
				</div> 
			</div>
			{/volist}
		{/notempty}

		{notempty name="vip_product"}
			{volist name="vip_product" id="vo"}
			<div class="product-cell"> 
				<div class="product-item" data-money='{$vo.price|floatval}'  data-type='{$vo.type}' data-activityid='0' data-payid='{$vo.id}' data-userlimit='0'> 
					 <div class="product-welth">
					  <span class="value">{if $i==6}<i class='iconfont icon-diamond' style='color:goldenrod'></i>{/if}{$vo.price|floatval}元</span>
					 </div> 
					<div class="product-info">VIP会员      <br /> {if $vo.type==1}多送{$vo.giveegold}书币{else /}{$vo.description}{/if}</div> 
				</div> 
			</div>
			{/volist}
		{/notempty}
	{else}
		{volist name="paysetting" id="vo"}
		<div class="product-cell"> 
			<div class="product-item {if $type && $vo.price ==$type}active{/if}{if empty($type)&&$i==2}active{/if}" data-money='{$vo.price|floatval}'  data-activityid='0' data-payid='{$vo.id}'  data-type='{$vo.type}' data-userlimit='0'> 
				 <div class="product-welth">
				  <span class="value">{if $i==6}<i class='iconfont icon-diamond' style='color:goldenrod'></i>{/if}{empty name="vo.title"}{$vo.price|floatval}元{else /}{$vo.title}{/empty}</span>
				 </div> 
				<div class="product-info">{if $vo.type==1}{$vo.egold}+{$vo.giveegold}书币{else /}{$vo.price|floatval}元{/if}      <br /> {if $vo.type==1}多送{$vo.giveegold}书币{else /}{$vo.description}{/if}</div> 
				{if empty($type)&&$pay_setting_diy&&$i==$pay_setting_diy['default_hot']}<i class='iconfont icon-hot'></i>{/if}
			</div> 
		</div> 
		{/volist}
	{/empty}
  </div>



            <p class="weui_btn_area" style="margin-top:20px">

                <a id="btn-pay-confirm" href="javascript:;" class="weui_btn weui_btn_primary">确 认 充 值</a>

            </p>
            
           <div style="margin:10px 10px;">
            温馨提示：
			<br/>
			1.充值获得的书币可以本公司旗下所有书城使用。
			<br/>
			2.若发现充值未到账，请先确认你登录的账号与充值的账号是否一致。
			<br/>
			3.书币为虚拟物品，一旦充值成功，不得以任何理由要求本公司退还全部或者部分充值款项，因不可抗力或本公司单方面原因导致的情况除外。
			<br/>
			4.充值后{:config('virtualname')}到账可能有延迟，1小时内未到账请联系{notempty name="cfgqq"}客服QQ：{$cfgqq}，{/notempty}{notempty name="cfgwechat"}客服微信：{$cfgwechat}，{/notempty}或拨打客服电话:{$cfgtel}
            </div>

        </div>

    </div>

</div>
 {block name="include"}{include file="public:tabbar" /}{/block}
{/block}
{block name="script"}
<script type="text/javascript" src="__PUBLIC__/ieasy/js/zepto.min.js?v=2.1.49"></script>
<script type="text/javascript" src="__PUBLIC__/ieasy/js/zepto.cookie.min.js?v=2.1.49"></script>


<script> 
	var ua = navigator.userAgent.toLowerCase();
	var pay_change = {$pay_change};
	var uid = {$user.uid};
	var submitting = false;

    $(function () {
		$('.head_return_page_but').click(function () {
			if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // IE
				if(history.length > 0){
					window.history.go( -1 );
				}else{
					window.location.href = "/";
				}
			}else{ //非IE浏览器
				if (navigator.userAgent.indexOf('Firefox') >= 0 ||
					navigator.userAgent.indexOf('Opera') >= 0 ||
					navigator.userAgent.indexOf('Safari') >= 0 ||
					navigator.userAgent.indexOf('Chrome') >= 0 ||
					navigator.userAgent.indexOf('WebKit') >= 0){
		 
					if(window.history.length > 1){
						window.history.go( -1 );
					}else{
						window.location.href = "/";
					}
				}else{ //未知的浏览器
					window.history.go( -1 );
				}
			}
		});

        $('#products-grid .product-item').click(function () {
            $('#products-grid .product-item').removeClass('active');
            $(this).addClass('active');
        });

        $('#btn-pay-confirm').click(function () {

            if (submitting) {
                return false;
            }

            submitting = true;
            var money = $('#products-grid .product-item.active').data('money');
			var type = $('#products-grid .product-item.active').data('type');
			var activityid = $('#products-grid .product-item.active').data('activityid');
			var payid = $('#products-grid .product-item.active').data('payid');
			var userlimit = $('#products-grid .product-item.active').data('userlimit');
            var payurl = "{$payurl}";
			var bookid = "{$bookid}";

			if(ua.match(/MicroMessenger/i)=="micromessenger") {
				if (pay_change==1)
				{
					document.location.href=payurl+'/pay/pay.html?egold='+money+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit+'&bookid='+bookid;
				}else{
					document.location.href=payurl+'/pay/thirdpay.html?egold='+money+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit+'&bookid='+bookid;
				}
			} else {
				if (pay_change==1)
				{
					//document.location.href=payurl+'/alipay/pay.html?egold='+money+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit;
					document.location.href=payurl+'/pay/wxh5pay.html?egold='+money+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit+'&bookid='+bookid;
				}else{
					document.location.href=payurl+'/pay/thirdalipay.html?egold='+money+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit+'&bookid='+bookid;
				}
			}
			setTimeout(function () { submitting = false }, 5000);  
			return false;

        })

    })
	
	
</script>

{/block}